import 'package:json_annotation/json_annotation.dart';

part 'base_model.g.dart';

// 执行命令 flutter pub run build_runner build
// 定义一个通用的 API 响应处理类
@JsonSerializable()
class BaseModel {
  final int errNum;
  final String msg;
  final dynamic data;
  final bool status;

  BaseModel({required this.errNum, required this.msg, this.data, required this.status});

  factory BaseModel.fromJson(Map<String, dynamic> json) => _$BaseModelFromJson(json);

  Map<String, dynamic> toJson() => _$BaseModelToJson(this);
}
